{% extends "base.html" %}
{% block title %} {{ project }} - Edit Pipelines{% endblock %}
{% block content %}

    <div class="page-content">
    	<div class="row">
		    <div class="col-md-3">
		  	    <div class="sidebar content-box" style="display: block;">
                    <div class="text-center">
                        <a href="{% url 'manageproject' project %}"><h2>{{ project }}</h2></a>
                        <a href="{% url 'addpipeline' project %}" class="btn btn-info btn-block" role="button">Add Pipeline</a>
                    </div>
                    <ul id="system-status" class="nav">
                        <li><a><i class="glyphicon glyphicon-stats"></i>System Status</a></li>
                    </ul>
                </div>
		    </div>
            <div class="col-md-9">
                <div class="content-box-large">
  				    <div class="panel-heading">
					    <div class="panel-title">Pipelines</div>
				    </div>
                    {% if items %}
  				    <div class="panel-body">
  					    <div class="table-responsive">
  						    <table class="table">
			                    <thead>
			                        <tr>
			                        <th>#</th>
			                        <th>Pipeline Name</th>
			                        <th>Order</th>
                                    <th>Operations</th>
			                        </tr>
			                    </thead>
			                    <tbody>
                                {% for i in items %}
                                    <tr>
                                    <td>{{ forloop.counter }}</td>
                                    <td>{{ i.0 }}</td>
                                    <td>{{ i.1 }}</td>
                                    <td>
                                    <a href="{% url 'editpipeline' project i.0 %}">Edit</a>
                                    <br/>
                                    <a href="{% url 'deletepipeline' project i.0 %}">Delete</a>
                                    </td>
                                    </tr>
                                {% endfor %}
			                    </tbody>
			                </table>
  					    </div>
  				    </div>
                    {% else %}
                    <div class="panel-body">
                        You don't have any pipelines in this project
                    </div>
                    {% endif %}
  			    </div>
            </div>
        </div>
    </div>

{% endblock %}

{% block custom_scripts %}

    <script>
    $(document).ready(function(){
        get_system_status();
});
    </script>

{% endblock %}